<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="description" content="长沙市妇幼医院">
    <link rel="stylesheet" type="text/css" href="./css/mobiscroll.2.13.2.css" />
    <script src="./js/jquery.min.js"></script>
    <script src="./js/mobiscroll.2.13.2.js"></script>
    <title>长沙市妇幼医院</title>


    <style>
        .remark {
            font-size: 12px;
            color: #07b8dd;
        }

        .sub-sheet {
            font-size: 12px;
        }
    </style>

    <style>
        body {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }

        h1,
        .h1,
        h2,
        .h2,
        h4,
        .h4,
        h4,
        .h4,
        .lead {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }
        .input-line{
            margin-left:10px;
            margin-right:10px;
            height:1px;border-top:1px solid #f3f3f3;
        }
        .select_content {
            bottom:4px;
            position:fixed;
            width: 100%;
            height: 50%;
            background-color:#fff;
            z-index:1001;
            /*overflow:scroll;*/
        }

        .input-line-s{
            height: 1px;
            border-top: 1px solid #f3f3f3;
        }
        .dw-day {
            font-size: 12px;
        }

        .sub-row {
            height: 30px;
        }

        .serologic-result-div {
            display: flex;
            justify-content: space-around;
            align-items: center;
            height: 50px;
        }

        .serologic-result-item {
            display: flex;
        }

        .serologic-result-item img {
            max-width: 100%;
            height: 17px;
        }

        .serologic-result-item span {
            font-size: 0.8em;
            padding-left: 5px;
        }

        .sel-info img {
            max-width: 100%;
            height: 22px;
            vertical-align: middle;
        }

        .serologic-img {
            width: 87px !important;
            height: 20px !important;
        }

        .sel-note {
            float: right;
            line-height: 46px;
            color: #c9c9c9;
            font-size: 16px;
        }
        .prompt_message_icon {
            float: left;
            padding-top: 11px;
            padding-left: 16px;
            width: 24px;
            height: 24px;
        }
        .prompt_message_s {
            float: left;
            color: #ffffff;
            font-size: 18px;
            padding-left: 0px;
            padding-top: 11px;
            margin: 0;
        }
        .coupon_sel_0{
            background:#ffb9af;
        }
        .coupon_sel_1{
            background:#e5e5e5;
        }
        .coupon_sel_tip{
            font-size:10px;
        }
        .coupon_sel_info{
            width:245px;
            height:60px;
            float:left;
            overflow: auto;
            margin:5px 0 0 0;
            background:rgba(255, 255, 255, 0);
        }
        .coupon_sel_tip{
            font-size:12px;
            height:20px;
            line-height:15px;
        }
        .coupon_sel_name{
            height:30px;
            line-height:24px;
        }
        .coupon_sel_icon{
            display:none;
            height:24px;
            width:24px;
        }
        .coupon_sel_iconbox{
            margin:0 5px 0 0;
            padding:10px 0 0 0;
            float:right;
            width:50px;
            height:60px;
        }
        .coupon_sel_status_0{
            text-align:center;
            font-size: 14px;
            padding:4px 0 0 0;
            height:30px;
            width:50px;
            line-height:24px;
            border-radius:8px;
            border: #c9c9c9 solid 2px;
        }
        .coupon_sel_status_1{
            font-size: 14px;
            text-align:center;
            padding:4px 0 0 0;
            height:30px;
            width:50px;
            line-height:24px;
            border-radius:8px;
            border: #c9c9c9 solid 2px;
            background:#dfdfdf;
        }

        .select-ul{
            list-style: none;
            margin:0;
            padding:0;
        }
        .select-ul li{
            line-height: 50px;
        }
    </style>
<script type="text/javascript">
    $(document).ready(function(){
        queryCoupon()
    })
    //搜索客户
    function queryCoupon(){
        doQuery();
        var rows=[{couponCode:'11B2232','couponName':'长沙市民生项目NIPT免费券',idCard:'4301081984022311',status:0},{couponCode:'11B2232','couponName':'长沙市民生项目NIPT免费券',idCard:'4301081984022311',status:1},{couponCode:'11B2232','couponName':'长沙市民生项目NIPT免费券',idCard:'4301081984022311',status:1}]
        var cusStr = '';
        if(rows) {
            for(var key in rows){
                var obj = rows[key];
                var couponStatus = obj.status==0?0:1
                var statusTip = obj.status==0?'未使用':'已使用'
                var str = `<li style="height:65px;" id="coupon-${key}" data-input="${obj.couponCode}" data-value="${obj.couponName}" class="sel-info coupon_sel_${couponStatus}" onclick="selCoupon(this);"><div class="coupon_sel_info"><div class="coupon_sel_name">${obj.couponName}</div><div class="coupon_sel_tip">限身份证号码为${obj.idCard}使用</div></div><div class="coupon_sel_iconbox"><img class="coupon_sel_icon" src="./images/order/coupon.png" /><div class="coupon_sel_status_${couponStatus}" >${statusTip}</div></div></li><li><div class="input-line"></div></li>`
                cusStr += str;
            }
            $('#couponBox').html(cusStr);
        } else {
            var str = '<li style="text-align:center;color: #00afee;" id="coupon-'+ 0 +'" data-input="'+''+'" data-value="'+''+'" class="sel-info" onclick="selCoupon(this);">'+'您还没有免费券,您可以在公众号点击菜单我的服务-->领取免费券'+'</li><div class="input-line"></div>';
            $('#couponBox').html(str);
        }
    }
    function doQuery(){
        $.ajax({
            type:"post",
            url:"queryCoupon.do",
            data:{},
            dataType:"json",
            success:function (data) {
                var rows = data.rows;
                var cusStr = '';
                if(rows) {
                    for(var key in rows){
                        var obj = rows[key];
                        var str = '<li id="customer-'+key+'" data-input="'+obj['couponCode']+'" data-value="'+obj['couponName']+'" class="sel-info" onclick="selCustomer(this);">'+obj['couponName']+'</li><div class="input-line"></div>';
                        cusStr += str;
                    }
                    $('#couponBox').html(cusStr);
                } else {
                    var str = '<li style="text-align:center;color: #00afee;" id="coupon-'+ 0 +'" data-input="'+''+'" data-value="'+''+'" class="sel-info" onclick="selCustomer(this);">'+'您还没有免费券,您可以在公众号点击菜单我的服务-->领取免费券'+'</li><div class="input-line"></div>';
                    $('#couponBox').html(str);
                }

            }
        });
    }
    var couponNum=''
    function initUrlInfo(){
        var url = location.search;
        url = decodeURI(url);
        url = decodeURI(url);
        var Request = new Object();
        if(url.indexOf("?")!=-1){
            var str = url.substr(1);//去掉?号
            strs = str.split("&");
            for(var i=0;i<strs.length;i++){
                var key = strs[i].split("=")[0];
                var value = unescape(strs[i].split("=")[1]);
                Request[key]=value;
                var keyId = '#' + key;
                $(keyId).text(value);
            }
        }
        self.couponNum = Request['couponNum']||'';
        if(self.couponNum){
            hasCoupon(true)
        }else{
            hasCoupon(false)
        }
    }
</script>


</head>

<body onload="orderSheetOnLoad();">
    <!-- 选择优惠券 -->
    <div id="couponSelDiv" class="select_content" style="height:100%;background: #ffffff">
        <div class="search">
            <div>
                <div style="height:40px;text-align:center;font-size:24px;padding:20px 0 0 0;margin:10px 0 10px 0;">已领取的免费券</div>
            </div>
        </div>
        <div class="input-line" style="width: 100%;"></div>
        <div style="height: 80%; overflow:hidden; background: #ffffff">
            <ul id="couponBox" class="select-ul" style="overflow:auto; height: 100%; -webkit-overflow-scrolling : touch;">
                <li style="text-align:center;margin-left:auto;margin-right:auto;color: #00afee;" id="customer-0" data-input="" data-value="" class="sel-info" onclick="selCoupon(this);">
                    <span>您还没有免费券,您可以在公众号点击菜单我的服务-->领取免费券</span>
                </li>
            </ul>
        </div>
     </div>
     <!-- 遮罩层 -->
    <div id="fade" class="black_overlay"></div>
    <!-- 提示框 -->
    <div id="tipDia" class="tips">
        <p id="tipmsg" class="tips-msg"></p>
        <div class="tips-line"></div>
        <p class="tips-close" onclick="closeTips();">知道了</p>
    </div>
</body>

</html>